﻿
namespace NavFx
{
	/// <summary>
	/// Application using the NavFx framwork
	/// </summary>
	public class Application: System.Windows.Application, IApplication
	{
		#region Private members

		private Navigator navigator = null;

		#endregion

		#region Public members

		/// <summary>
		/// Returns a reference to NavFx Navigator
		/// </summary>
		/// <remarks>
		/// Having this reference available means that even
		/// basic pages that integrate with the NavFx framework
		/// but don't host other pages can use the Navigator
		/// for example to return to a home page
		/// </remarks>
		public Navigator GetNavigator()
		{
			if(this.navigator == null)
			{
				//first time of requesting
				//create a new instance
				this.navigator = new Navigator();
			}

			return this.navigator;
		}

		///// <summary>
		///// Provides access to Resources collection of base
		///// </summary>
		//public new ResourceDictionary Resources
		//{
		//    get
		//    {
		//        return base.Resources;
		//    }
		//}
		#endregion

		#region Constructors

		/// <summary>
		/// Default constructor
		/// </summary>
		public Application()
			: base()
		{
		}

		#endregion
	}
}
